import App from './App'
import {
	router,
	RouterMount
} from './router/index.js'
Vue.use(router)
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
import store from '@/store'
Vue.prototype.$store = store;
import MLoad from "@/components/MLoad/index.vue";
import MTabbar from '@/components/MTabbar/index.vue'
import MNavBar from '@/components/MNavBar/index.vue'
import mpShare from './mixin/mpShare'
Vue.component("MLoad", MLoad);
Vue.component("MTabbar", MTabbar);
Vue.component("MNavBar", MNavBar);

Vue.prototype.$onLaunched = new Promise(resolve => {
	Vue.prototype.$isResolve = resolve
})

let vuexStore = require("@/store/$u.mixin.js");
Vue.mixin(vuexStore);
Vue.mixin(mpShare)

const app = new Vue({
	store,
	...App
})
import '@/utils/request.js';
// #ifdef H5
RouterMount(app, router, '#app')
// #endif

// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif

// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif